import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description: 班级活动
 * User: DELL
 * Date: 2024-05-23
 * Time: 11:55
 */
public class Main3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        HashMap<Integer, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            int num = scanner.nextInt();
            map.put(num, map.getOrDefault(num, 0) + 1);
        }
        int moreNum = 0;
        int lessNum = 0;
        for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
            if (entry.getValue() > 2) {
                moreNum += entry.getValue() - 2;
            }
            if (entry.getValue() == 1) {
                lessNum++;
            }
        }
        if (moreNum >= lessNum) {
            System.out.println(moreNum);
        } else {
            System.out.println(moreNum + ((lessNum - moreNum) / 2));
        }
    }
}
